package com.ruoyi.web.pojo;

import com.ruoyi.web.entity.SysRole;
import com.ruoyi.web.entity.SysUser;

public class AdminUtils {

    public static boolean userIsAdmin(SysUser user) {
        return userIsAdmin(user.getUserId());
    }

    public static boolean userIsAdmin(Long userId) {
        return userId != null && 1L == userId;
    }

    public static boolean roleIsAdmin(SysRole role) {
        return roleIsAdmin(role.getRoleId());
    }

    public static boolean roleIsAdmin(Long roleId) {
        return roleId != null && 1L == roleId;
    }
}
